home *** CD-ROM | disk | FTP | other *** search
- Path: news.th-darmstadt.de!news
- From: Enno Sandner <enno@intellektik.informatik.th-darmstadt.de>
- Newsgroups: comp.lang.c++
- Subject: Re: A LINKed LIST Question
- Date: Thu, 18 Apr 1996 13:37:40 +0200
- Organization: Fachbereich Informatik, TH Darmstadt
- Message-ID: <31762984.59E2B600@intellektik.informatik.th-darmstadt.de>
- References: <4l4m21$sr1@falcon.ccs.uwo.ca>
- NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (X11; I; SunOS 4.1.3 sun4m)
-
- Sharon Wang wrote:
- >
- > I have the following def'n
- >
- > class Node {
- > ItemType item1; // ItemType define
- > ItemType item2;
- > ...
- > public:
- > functions on item;
- > };
- >
- > class NodeList {
- > Node N;
- > Node* FLink;
- > Node* BLink;
- > public:
- > functions on Node;
- > };
- >
- > However, I can't access the members of Node in the list since
- > they are "private". How can I get arount this WIHTOUT using
- > access functions in class Node.
- >
-
- Declare 'NodeList' as friend of 'Node':
- class Node {
- friend class NodeList;
- ...
- };
-
- Enno
-